<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Minimal Django File Upload Example</title>
	</head>

	<body>
		
		<!-- Upload form. Note enctype attribute! -->
		<form action="{% url list %}" method="post" enctype="multipart/form-data">
			{% csrf_token %}
				<p>{{ form.non_field_errors }}</p>
				<p>{{ form.docfile.label_tag }} {{ form.docfile.help_text }}</p>
				<p>
					{{ form.docfile.errors }}
					{{ form.docfile }}
				</p>
				<p><input type="submit" value="Upload" /></p>
		</form>
		<!-- process -->
		<!-- List of uploaded documents -->
		{% if documents %}
			<ul>
				{% for document in documents %}
				<li><a href="{{ document.docfile.url }}">{{ document.docfile.name }}</a></li>
				{% endfor %}
			</ul>
				{% else %}
				<p>No documents.</p>
		{% endif %}
		
	</body>

</html> 